#include<iostream>
#include<thread>
#include<future>
#include<memory>

int Add(int num1,int num2){
    std::cout << "into add!\n";
    return num1+num2;
}

int main()
{
    std::promise<int> pro;
    std::future<int> res = pro.get_future();

    std::thread thr([&pro]{
        pro.set_value(Add(22,33));
    });

    std::this_thread::sleep_for(std::chrono::seconds(1));
    std::cout << "----------------\n";
    std::cout << res.get() << std::endl;
    thr.join();
}